<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>simvoc.core.scheduler.Scheduler</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="simvoc-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            >SimVOC</th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="simvoc-module.html">Package&nbsp;simvoc</a> ::
        <a href="simvoc.core-module.html">Package&nbsp;core</a> ::
        <a href="simvoc.core.scheduler-module.html">Module&nbsp;scheduler</a> ::
        Class&nbsp;Scheduler
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class Scheduler</h1><p class="nomargin-top"><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler">source&nbsp;code</a></span></p>
<center>
<center>  <map id="uml_class_diagram_for_simvoc_c_45" name="uml_class_diagram_for_simvoc_c_45">
<area shape="rect" id="node109" href="simvoc.core.scheduler.Scheduler-class.html#__init__" title="x.__init__(...) initializes x; see x.__class__.__doc__ for signature" alt="" coords="140,39,461,57"/>
<area shape="rect" id="node109" href="simvoc.core.scheduler.Scheduler-class.html#add_resource" title="Adds a resource to the resource broker map." alt="" coords="140,57,461,76"/>
<area shape="rect" id="node109" href="simvoc.core.scheduler.Scheduler-class.html#add_scheduler_event" title="Adds a scheduler event for a time not in the past." alt="" coords="140,76,461,95"/>
<area shape="rect" id="node109" href="simvoc.core.scheduler.Scheduler-class.html#add_submit_event" title="Schedules an event to submit a job at a time not in the past." alt="" coords="140,95,461,113"/>
<area shape="rect" id="node109" href="simvoc.core.scheduler.Scheduler-class.html#add_target" title="Adds a target machine to the scheduler pool." alt="" coords="140,113,461,132"/>
<area shape="rect" id="node109" href="simvoc.core.scheduler.Scheduler-class.html#add_targets" title="Adds a list of scheduling targets to the pool." alt="" coords="140,132,461,151"/>
<area shape="rect" id="node109" href="simvoc.core.scheduler.Scheduler-class.html#adjust_metric" title="Changes an aggregation metric field." alt="" coords="140,151,461,169"/>
<area shape="rect" id="node109" href="simvoc.core.scheduler.Scheduler-class.html#adjust_vo" title="Adjust the aggregation metrics for a single VO." alt="" coords="140,169,461,188"/>
<area shape="rect" id="node109" href="simvoc.core.scheduler.Scheduler-class.html#cancel_job" title="Cancels a job that has NOT YET STARTED." alt="" coords="140,188,461,207"/>
<area shape="rect" id="node109" href="simvoc.core.scheduler.Scheduler-class.html#check_schedule" title="Conditionally adds a scheduling event (a simulator&#45;induced call to the &#160;schedule() method) if such an event is not already pending AND there are &#160;jobs waiting in the queue." alt="" coords="140,207,461,225"/>
<area shape="rect" id="node109" href="simvoc.core.scheduler.Scheduler-class.html#claim_slot" title="Attempts to claim a free machine (CPU core) for the purpose of starting a &#160;job on that core." alt="" coords="140,225,461,244"/>
<area shape="rect" id="node109" href="simvoc.core.scheduler.Scheduler-class.html#debug" title="Writes debugging messages back to the simulator debugging interface." alt="" coords="140,244,461,263"/>
<area shape="rect" id="node109" href="simvoc.core.scheduler.Scheduler-class.html#enqueue_job" title="Adds a job to the scheduler queue." alt="" coords="140,263,461,281"/>
<area shape="rect" id="node109" href="simvoc.core.scheduler.Scheduler-class.html#submit_trigger" title="Method to be called by a simulator event whenever a job is scheduled for &#160;submission." alt="" coords="140,300,461,319"/>
<area shape="rect" id="node1" href="simvoc.core.scheduler.Scheduler-class.html" title="Generic job scheduler, which starts jobs instantly if nodes are available." alt="" coords="128,6,472,325"/>
<area shape="rect" id="node2" href="simvoc.core.condor_sim.Condor-class.html" title="Simulation of the Condor interval scheduler (negotiation process only)." alt="" coords="5,345,152,383"/>
<area shape="rect" id="node3" href="simvoc.core.control_scheduler.ControlScheduler-class.html" title="Scheduler replacement that uses observed queue delays to replicate the behavior of the actual grid." alt="" coords="181,345,421,383"/>
<area shape="rect" id="node4" href="simvoc.core.metascheduler.Metascheduler-class.html" title="Simple metascheduler: sends jobs to the site with the lowest projected waiting time, based on a ranking algorithm." alt="" coords="451,345,661,383"/>
</map>
  <img src="uml_class_diagram_for_simvoc_c_45.gif" alt='' usemap="#uml_class_diagram_for_simvoc_c_45" ismap="ismap" class="graph-without-title" />
</center>
</center>
<hr />
<p>Generic job scheduler, which starts jobs instantly if nodes are 
  available. Otherwise, jobs are queued until running jobs complete, at 
  which time new jobs are immediately started. The scheduling discipline is
  FIFO.</p>

<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Instance Methods</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-InstanceMethods"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">simobj</span>,
        <span class="summary-sig-arg">name</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string">Scheduler</code><code class="variable-quote">'</code></span>,
        <span class="summary-sig-arg">tag</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string"></code><code class="variable-quote">'</code></span>,
        <span class="summary-sig-arg">**kwds</span>)</span><br />
      x.__init__(...) initializes x; see x.__class__.__doc__ for signature</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.__init__">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#add_resource" class="summary-sig-name">add_resource</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">service_name</span>,
        <span class="summary-sig-arg">obj</span>)</span><br />
      Adds a resource to the resource broker map.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.add_resource">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#add_scheduler_event" class="summary-sig-name">add_scheduler_event</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">time</span>)</span><br />
      Adds a scheduler event for a time not in the past.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.add_scheduler_event">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#add_submit_event" class="summary-sig-name">add_submit_event</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">time</span>,
        <span class="summary-sig-arg">job</span>)</span><br />
      Schedules an event to submit a job at a time not in the past.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.add_submit_event">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#add_target" class="summary-sig-name">add_target</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">machine</span>)</span><br />
      Adds a target machine to the scheduler pool.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.add_target">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#add_targets" class="summary-sig-name">add_targets</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">machine_list</span>)</span><br />
      Adds a list of scheduling targets to the pool.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.add_targets">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#adjust_metric" class="summary-sig-name">adjust_metric</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">field</span>,
        <span class="summary-sig-arg">adj</span>)</span><br />
      Changes an aggregation metric field.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.adjust_metric">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#adjust_vo" class="summary-sig-name">adjust_vo</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">vo</span>,
        <span class="summary-sig-arg">field</span>,
        <span class="summary-sig-arg">adj</span>)</span><br />
      Adjust the aggregation metrics for a single VO.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.adjust_vo">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#cancel_job" class="summary-sig-name">cancel_job</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">job</span>)</span><br />
      Cancels a job that has NOT YET STARTED.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.cancel_job">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">bool</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#check_schedule" class="summary-sig-name">check_schedule</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">delay</span>=<span class="summary-sig-default">0</span>)</span><br />
      Conditionally adds a scheduling event (a simulator-induced call to 
      the schedule() method) if such an event is not already pending AND 
      there are jobs waiting in the queue.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.check_schedule">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">bool</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#claim_slot" class="summary-sig-name">claim_slot</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">machine</span>)</span><br />
      Attempts to claim a free machine (CPU core) for the purpose of 
      starting a job on that core.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.claim_slot">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#debug" class="summary-sig-name">debug</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">message</span>)</span><br />
      Writes debugging messages back to the simulator debugging interface.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.debug">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#enqueue_job" class="summary-sig-name">enqueue_job</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">job</span>)</span><br />
      Adds a job to the scheduler queue.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.enqueue_job">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">bool</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#event_pending" class="summary-sig-name">event_pending</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Returns:
      True iff a scheduling event is pending</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.event_pending">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#free_slot" class="summary-sig-name">free_slot</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">machine</span>)</span><br />
      Marks a machine (CPU core) as free and return it to the list of free 
      scheduling targets.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.free_slot">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">int</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#get_completed_count" class="summary-sig-name">get_completed_count</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">vo</span>=<span class="summary-sig-default">None</span>)</span><br />
      Returns:
      number of jobs that have completed for a single VO or for the entire 
      scheduler.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.get_completed_count">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#get_count" class="summary-sig-name">get_count</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">field</span>,
        <span class="summary-sig-arg">vo</span>=<span class="summary-sig-default">None</span>)</span><br />
      Returns the value of a metric for the scheduler aggregation or for a 
      single Virtual Organization.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.get_count">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">int</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#get_cpu_count" class="summary-sig-name">get_cpu_count</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Returns:
      total number of scheduler slots</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.get_cpu_count">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">int</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#get_error_count" class="summary-sig-name">get_error_count</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">vo</span>=<span class="summary-sig-default">None</span>)</span><br />
      Returns:
      number of job errors observed for a single VO or for the entire 
      scheduler.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.get_error_count">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">int</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#get_free_count" class="summary-sig-name">get_free_count</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Returns:
      total number of free scheduler slots</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.get_free_count">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#get_metric" class="summary-sig-name">get_metric</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">field</span>)</span><br />
      Returns the value of the metric for a given field.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.get_metric">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#get_resource" class="summary-sig-name">get_resource</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">service_name</span>)</span><br />
      Returns:
      a reference to a resource object, if the resource is available from 
      the scheduler.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.get_resource">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">int</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#get_running_count" class="summary-sig-name">get_running_count</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">vo</span>=<span class="summary-sig-default">None</span>)</span><br />
      Returns:
      number of jobs currently running for a single VO or for the entire 
      scheduler</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.get_running_count">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">int</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#get_total_queue_size" class="summary-sig-name">get_total_queue_size</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">vo</span>=<span class="summary-sig-default">None</span>)</span><br />
      Returns:
      total queue size (waiting+running) for a single VO or for the entire 
      scheduler.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.get_total_queue_size">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type"><a href="simvoc.core.results.SchedResult-class.html" 
      class="link">results.SchedResult</a></span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="get_update"></a><span class="summary-sig-name">get_update</span>(<span class="summary-sig-arg">self</span>)</span><br />
      Obtains information about the current state of the scheduler.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.get_update">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#get_vo" class="summary-sig-name">get_vo</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">vo</span>,
        <span class="summary-sig-arg">field</span>)</span><br />
      Returns an aggregation metric for a single VO.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.get_vo">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">int</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#get_waiting_count" class="summary-sig-name">get_waiting_count</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">vo</span>=<span class="summary-sig-default">None</span>)</span><br />
      Returns:
      number of jobs waiting in the queue for a single VO or for the entire
      scheduler</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.get_waiting_count">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">bool</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#is_target" class="summary-sig-name">is_target</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">machine</span>)</span><br />
      Returns:
      True iff machine is part of the scheduler pool</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.is_target">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#job_done" class="summary-sig-name">job_done</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">machine</span>,
        <span class="summary-sig-arg">job</span>)</span><br />
      Callback method used by a Job to notify the scheduler that the job is
      finishing.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.job_done">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">list</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#kill_all" class="summary-sig-name">kill_all</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">field_name</span>,
        <span class="summary-sig-arg">value</span>)</span><br />
      Kills all jobs for which the field name matches a specified value.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.kill_all">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#kill_job" class="summary-sig-name">kill_job</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">job</span>)</span><br />
      Immediately kills a job, whether the job is running or not.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.kill_job">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#mark_complete" class="summary-sig-name">mark_complete</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">machine</span>,
        <span class="summary-sig-arg">job</span>)</span><br />
      Marks a job as complete, adjusting the metrics and freeing the 
      associated slot.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.mark_complete">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#pick_slot" class="summary-sig-name">pick_slot</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">job</span>)</span><br />
      Selects a free machine from the free scheduling target list.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.pick_slot">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#remove_resource" class="summary-sig-name">remove_resource</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">service_name</span>)</span><br />
      Removes a resource from the resource broker map.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.remove_resource">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#remove_target" class="summary-sig-name">remove_target</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">machine</span>)</span><br />
      Removes a target machine from the scheduler pool.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.remove_target">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#remove_targets" class="summary-sig-name">remove_targets</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">machine_list</span>)</span><br />
      Removes a list of target machines from the scheduler pool.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.remove_targets">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#schedule" class="summary-sig-name">schedule</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">time</span>,
        <span class="summary-sig-arg">simobj</span>)</span><br />
      Core FIFO/FCFS scheduling algorithm.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.schedule">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#set_metric" class="summary-sig-name">set_metric</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">field</span>,
        <span class="summary-sig-arg">qty</span>)</span><br />
      Sets the value of an aggregation metric.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.set_metric">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#set_vo" class="summary-sig-name">set_vo</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">vo</span>,
        <span class="summary-sig-arg">field</span>,
        <span class="summary-sig-arg">qty</span>)</span><br />
      Sets the value of an aggregation metric for a specific VO.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.set_vo">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#set_watchdog_callback" class="summary-sig-name">set_watchdog_callback</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">wdfn</span>)</span><br />
      Sets a callback function to be called whenever a job is added to the 
      scheduler queue.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.set_watchdog_callback">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type"><a href="simvoc.core.results.JobStartResult-class.html" 
      class="link">results.JobStartResult</a></span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#start_job" class="summary-sig-name">start_job</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">job</span>,
        <span class="summary-sig-arg">machine</span>)</span><br />
      Starts a job on a machine.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.start_job">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#submit_job" class="summary-sig-name">submit_job</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">job</span>)</span><br />
      Receives a job into the scheduler.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.submit_job">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="simvoc.core.scheduler.Scheduler-class.html#submit_trigger" class="summary-sig-name">submit_trigger</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">job</span>)</span><br />
      Method to be called by a simulator event whenever a job is scheduled 
      for submission.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.submit_trigger">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__delattr__</code>,
      <code>__format__</code>,
      <code>__getattribute__</code>,
      <code>__hash__</code>,
      <code>__new__</code>,
      <code>__reduce__</code>,
      <code>__reduce_ex__</code>,
      <code>__repr__</code>,
      <code>__setattr__</code>,
      <code>__sizeof__</code>,
      <code>__str__</code>,
      <code>__subclasshook__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== PROPERTIES ==================== -->
<a name="section-Properties"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Properties</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Properties"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code>object</code></b>:
      <code>__class__</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Method Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-MethodDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="__init__"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">simobj</span>,
        <span class="sig-arg">name</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string">Scheduler</code><code class="variable-quote">'</code></span>,
        <span class="sig-arg">tag</span>=<span class="sig-default"><code class="variable-quote">'</code><code class="variable-string"></code><code class="variable-quote">'</code></span>,
        <span class="sig-arg">**kwds</span>)</span>
    <br /><em class="fname">(Constructor)</em>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.__init__">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>x.__init__(...) initializes x; see x.__class__.__doc__ for 
  signature</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>simobj</code></strong> - Reference to the simulator object</li>
        <li><strong class="pname"><code>name</code></strong> (str) - Name of the scheduler</li>
        <li><strong class="pname"><code>tag</code></strong> (str) - Optional scheduler tag</li>
        <li><strong class="pname"><code>kwds</code></strong> - Scheduler extra data</li>
    </ul></dd>
    <dt>Overrides:
        object.__init__
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="add_resource"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">add_resource</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">service_name</span>,
        <span class="sig-arg">obj</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.add_resource">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Adds a resource to the resource broker map.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>service_name</code></strong> (str) - Name of the resource</li>
        <li><strong class="pname"><code>obj</code></strong> - Resource object</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="add_scheduler_event"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">add_scheduler_event</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">time</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.add_scheduler_event">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Adds a scheduler event for a time not in the past. An Exception will 
  be raised if a scheduler event is already pending, or if the time is in 
  the past.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>time</code></strong> (number) - Time at which the scheduler should run</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="add_submit_event"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">add_submit_event</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">time</span>,
        <span class="sig-arg">job</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.add_submit_event">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Schedules an event to submit a job at a time not in the past.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>time</code></strong> (number) - Time at which job should be submitted</li>
        <li><strong class="pname"><code>job</code></strong> - Job to submit</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="add_target"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">add_target</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">machine</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.add_target">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Adds a target machine to the scheduler pool. A single Machine instance
  can occur in the pool at most once. Adding a machine already present in 
  the pool will result in an Exception being raised.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>machine</code></strong> - Target machine to add</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="add_targets"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">add_targets</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">machine_list</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.add_targets">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Adds a list of scheduling targets to the pool. Each target in the list
  must be unique, and no target may already be present in the pool, 
  otherwise an Exception will occur.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>machine_list</code></strong> - List or sequence of target machines to add</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="adjust_metric"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">adjust_metric</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">field</span>,
        <span class="sig-arg">adj</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.adjust_metric">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Changes an aggregation metric field. This aggregation is used to count
  the numbers of jobs waiting, running, and completed, as well as to total 
  errors, job count, and free nodes.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>field</code></strong> (int) - Field number (use SM_ constant from <a 
          href="simvoc.core.core_common-module.html" 
          class="link">core_common</a>)</li>
        <li><strong class="pname"><code>adj</code></strong> (int) - Adjustment (positive or negative offset)</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="adjust_vo"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">adjust_vo</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">vo</span>,
        <span class="sig-arg">field</span>,
        <span class="sig-arg">adj</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.adjust_vo">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Adjust the aggregation metrics for a single VO. Field constants, with 
  the SM_ prefix, may be found in the core_common module. Note that 
  SM_TOTAL and SM_FREE are not tracked for VO data.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>vo</code></strong> (str) - Virtual Organization name</li>
        <li><strong class="pname"><code>field</code></strong> (int) - Field number (use SM_ constant)</li>
        <li><strong class="pname"><code>adj</code></strong> (int) - Adjustment factor (positive or negative offset)</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="cancel_job"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">cancel_job</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">job</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.cancel_job">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Cancels a job that has NOT YET STARTED. Exceptions will occur if this 
  method is run on a job that has already been scheduled. It is recommended
  that client code call the kill_job() method instead.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>job</code></strong> - Job to be canceled</li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>scheduler status result collection</dd>
  </dl>
</td></tr></table>
</div>
<a name="check_schedule"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">check_schedule</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">delay</span>=<span class="sig-default">0</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.check_schedule">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Conditionally adds a scheduling event (a simulator-induced call to the
  schedule() method) if such an event is not already pending AND there are 
  jobs waiting in the queue.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>delay</code></strong> (number) - Optional scheduling delay to add</li>
    </ul></dd>
    <dt>Returns: bool</dt>
        <dd>True iff a scheduling event was added</dd>
  </dl>
</td></tr></table>
</div>
<a name="claim_slot"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">claim_slot</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">machine</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.claim_slot">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Attempts to claim a free machine (CPU core) for the purpose of 
  starting a job on that core. If the machine can be claimed, it is removed
  from the list of free scheduling targets.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>machine</code></strong> - Machine object whose claim() method will be called</li>
    </ul></dd>
    <dt>Returns: bool</dt>
        <dd>True iff successful</dd>
  </dl>
</td></tr></table>
</div>
<a name="debug"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">debug</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">message</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.debug">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Writes debugging messages back to the simulator debugging interface. 
  Useful for developing subclasses.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>message</code></strong> (str) - Message to be written</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="enqueue_job"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">enqueue_job</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">job</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.enqueue_job">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Adds a job to the scheduler queue. If a watchdog callback function has
  been set, then the callback will be activated.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>job</code></strong> - Job to add to the queue</li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>a result collection or single result for simulator output</dd>
  </dl>
</td></tr></table>
</div>
<a name="event_pending"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">event_pending</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.event_pending">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  
  <dl class="fields">
    <dt>Returns: bool</dt>
        <dd>True iff a scheduling event is pending</dd>
  </dl>
</td></tr></table>
</div>
<a name="free_slot"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">free_slot</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">machine</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.free_slot">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Marks a machine (CPU core) as free and return it to the list of free 
  scheduling targets.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>machine</code></strong> - Machine object to mark as free</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="get_completed_count"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">get_completed_count</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">vo</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.get_completed_count">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>vo</code></strong> - VO name (str) or None (for whole scheduler data)</li>
    </ul></dd>
    <dt>Returns: int</dt>
        <dd>number of jobs that have completed for a single VO or for the 
          entire scheduler.</dd>
  </dl>
</td></tr></table>
</div>
<a name="get_count"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">get_count</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">field</span>,
        <span class="sig-arg">vo</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.get_count">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Returns the value of a metric for the scheduler aggregation or for a 
  single Virtual Organization. Field constants have the prefix SM_ and may 
  be found in the core_common module.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>field</code></strong> (int) - Field number (use SM_ constant)</li>
        <li><strong class="pname"><code>vo</code></strong> - VO name (str) or None (for scheduler aggregation)</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="get_cpu_count"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">get_cpu_count</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.get_cpu_count">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  
  <dl class="fields">
    <dt>Returns: int</dt>
        <dd>total number of scheduler slots</dd>
  </dl>
</td></tr></table>
</div>
<a name="get_error_count"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">get_error_count</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">vo</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.get_error_count">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>vo</code></strong> - VO name (str) or None (for whole scheduler data)</li>
    </ul></dd>
    <dt>Returns: int</dt>
        <dd>number of job errors observed for a single VO or for the entire 
          scheduler.</dd>
  </dl>
</td></tr></table>
</div>
<a name="get_free_count"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">get_free_count</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.get_free_count">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  
  <dl class="fields">
    <dt>Returns: int</dt>
        <dd>total number of free scheduler slots</dd>
  </dl>
</td></tr></table>
</div>
<a name="get_metric"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">get_metric</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">field</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.get_metric">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Returns the value of the metric for a given field. Field constants 
  have the SM_ prefix and may be found in the core_common module.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>field</code></strong> (int) - Field number (use SM_ constant)</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="get_resource"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">get_resource</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">service_name</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.get_resource">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>service_name</code></strong> (str) - Name of the resource to retrieve</li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>a reference to a resource object, if the resource is available 
          from the scheduler. If the resource is not available, this method
          will return None.</dd>
  </dl>
</td></tr></table>
</div>
<a name="get_running_count"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">get_running_count</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">vo</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.get_running_count">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>vo</code></strong> - VO name (str) or None (for whole scheduler data)</li>
    </ul></dd>
    <dt>Returns: int</dt>
        <dd>number of jobs currently running for a single VO or for the 
          entire scheduler</dd>
  </dl>
</td></tr></table>
</div>
<a name="get_total_queue_size"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">get_total_queue_size</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">vo</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.get_total_queue_size">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>vo</code></strong> - VO name (str) or None (for whole scheduler data)</li>
    </ul></dd>
    <dt>Returns: int</dt>
        <dd>total queue size (waiting+running) for a single VO or for the 
          entire scheduler.</dd>
  </dl>
</td></tr></table>
</div>
<a name="get_vo"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">get_vo</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">vo</span>,
        <span class="sig-arg">field</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.get_vo">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Returns an aggregation metric for a single VO. Field constants have 
  the prefix SM_ and may be found in core_common.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>vo</code></strong> (str) - Virtual Organization name</li>
        <li><strong class="pname"><code>field</code></strong> (int) - Field number (use SM_ constant)</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="get_waiting_count"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">get_waiting_count</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">vo</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.get_waiting_count">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>vo</code></strong> - VO name (str) or None (for whole scheduler data)</li>
    </ul></dd>
    <dt>Returns: int</dt>
        <dd>number of jobs waiting in the queue for a single VO or for the 
          entire scheduler</dd>
  </dl>
</td></tr></table>
</div>
<a name="is_target"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">is_target</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">machine</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.is_target">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>machine</code></strong> - Machine to test for membership in the pool</li>
    </ul></dd>
    <dt>Returns: bool</dt>
        <dd>True iff machine is part of the scheduler pool</dd>
  </dl>
</td></tr></table>
</div>
<a name="job_done"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">job_done</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">machine</span>,
        <span class="sig-arg">job</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.job_done">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Callback method used by a Job to notify the scheduler that the job is 
  finishing.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>machine</code></strong> - Machine on which the job was running</li>
        <li><strong class="pname"><code>job</code></strong> - Job that is finishing</li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>scheduler status result collection</dd>
  </dl>
</td></tr></table>
</div>
<a name="kill_all"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">kill_all</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">field_name</span>,
        <span class="sig-arg">value</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.kill_all">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Kills all jobs for which the field name matches a specified value. To 
  kill all jobs known to the scheduler, pass None to both arguments. The 
  special field name &quot;job_id&quot; matches the job name, while 
  &quot;vo&quot; matches the Virtual Organization with which the job is 
  associated.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>field_name</code></strong> (str) - Name of job extra_data field or above special name</li>
        <li><strong class="pname"><code>value</code></strong> - Value of the field to match (test uses ==)</li>
    </ul></dd>
    <dt>Returns: list</dt>
        <dd>list of jobs that have been killed</dd>
  </dl>
</td></tr></table>
</div>
<a name="kill_job"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">kill_job</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">job</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.kill_job">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Immediately kills a job, whether the job is running or not. If the job
  has not yet been scheduled, it will be canceled. The job must not yet 
  have completed (i.e. must be either in the queue or on the running list),
  or an Exception will be raised.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>job</code></strong> - Job to kill</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="mark_complete"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">mark_complete</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">machine</span>,
        <span class="sig-arg">job</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.mark_complete">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Marks a job as complete, adjusting the metrics and freeing the 
  associated slot.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>machine</code></strong> - Machine on which job was running</li>
        <li><strong class="pname"><code>job</code></strong> - Job to be marked complete</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="pick_slot"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">pick_slot</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">job</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.pick_slot">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Selects a free machine from the free scheduling target list. Since a 
  machine could mark itself as claimed, or another scheduler could claim 
  it, this method may not find a free machine.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>job</code></strong> - Job object. Unused in this base implementation, but may be used 
          by subclasses for purposes such as requirements matching.</li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>Machine object in the free scheduling targets list if one is 
          available (unclaimed). If there are no unclaimed targets, or the 
          free list is empty, this method will return None.</dd>
  </dl>
</td></tr></table>
</div>
<a name="remove_resource"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">remove_resource</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">service_name</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.remove_resource">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Removes a resource from the resource broker map. The resource must be 
  present in the map, or an Exception will occur.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>service_name</code></strong> (str) - Name of resource to remove</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="remove_target"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">remove_target</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">machine</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.remove_target">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Removes a target machine from the scheduler pool. If the target 
  machine is not in the pool, an Exception will be raised.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>machine</code></strong> - Target machine to remove from the pool</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="remove_targets"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">remove_targets</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">machine_list</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.remove_targets">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Removes a list of target machines from the scheduler pool. Each target
  machine must be unique in the list and must already be present in the 
  pool, or an Exception will be raised.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>machine_list</code></strong> - List or sequence of target machines to remove</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="schedule"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">schedule</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">time</span>,
        <span class="sig-arg">simobj</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.schedule">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Core FIFO/FCFS scheduling algorithm. This method should be called 
  whenever jobs complete and others are waiting, or when jobs arrive and 
  there are free slots available. Subclasses should generally either 
  override this method or bypass this method by overriding other methods 
  that call this method.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>time</code></strong> (number) - Current simulated time</li>
        <li><strong class="pname"><code>simobj</code></strong> - Reference to the simulator object</li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>result collection (1-tuple containing a list of results) for 
          simulator output</dd>
  </dl>
</td></tr></table>
</div>
<a name="set_metric"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">set_metric</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">field</span>,
        <span class="sig-arg">qty</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.set_metric">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Sets the value of an aggregation metric. Field constants, with the SM_
  prefix, may be found in core_common.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>field</code></strong> (int) - Field number (use SM_ constant)</li>
        <li><strong class="pname"><code>qty</code></strong> (int) - Value to which the field is to be set</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="set_vo"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">set_vo</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">vo</span>,
        <span class="sig-arg">field</span>,
        <span class="sig-arg">qty</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.set_vo">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Sets the value of an aggregation metric for a specific VO. If the VO 
  has not yet been registered, it will be added to the aggregation 
  structure. Field names, with the prefix SM_, may be found in the 
  core_common module.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>vo</code></strong> (str) - Virtual Organization name</li>
        <li><strong class="pname"><code>field</code></strong> (int) - Field number (use SM_ constant)</li>
        <li><strong class="pname"><code>qty</code></strong> (int) - Value to which the specified field should be set</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="set_watchdog_callback"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">set_watchdog_callback</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">wdfn</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.set_watchdog_callback">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Sets a callback function to be called whenever a job is added to the 
  scheduler queue. This callback function is intended for use with VOC 
  simulations that use a Watchdog component to monitor the queue size.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>wdfn</code></strong> - Function to be called</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="start_job"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">start_job</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">job</span>,
        <span class="sig-arg">machine</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.start_job">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Starts a job on a machine. The machine must already have been claimed 
  using the claim_slot() method.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>job</code></strong> - Job to be started</li>
        <li><strong class="pname"><code>machine</code></strong> - Claimed machine on which job is to be run</li>
    </ul></dd>
    <dt>Returns: <a href="simvoc.core.results.JobStartResult-class.html" 
      class="link">results.JobStartResult</a></dt>
  </dl>
</td></tr></table>
</div>
<a name="submit_job"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">submit_job</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">job</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.submit_job">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Receives a job into the scheduler. This method should be called either
  directly or as a result of a submit event executing, whenever a job needs
  to be added to the scheduler queue.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>job</code></strong> - Job to be submitted</li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>a result collection (1-tuple containing a list)</dd>
  </dl>
</td></tr></table>
</div>
<a name="submit_trigger"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">submit_trigger</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">job</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="simvoc.core.scheduler-pysrc.html#Scheduler.submit_trigger">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Method to be called by a simulator event whenever a job is scheduled 
  for submission. This method simply calls the submit_job() method and 
  exists simply to allow subclasses to override it.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>job</code></strong> - Job to be submitted</li>
    </ul></dd>
    <dt>Returns:</dt>
        <dd>a result collection</dd>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="simvoc-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            >SimVOC</th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0 on Fri Oct 23 11:04:33 2009
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
